<?php
class Useradmin_Data_Userlist {
	
	private $database;
	
	public function __construct(){
		$this->database = new Core_Driver_MysqlImproved;
	}
	
	public function getUserList(){
		$this->database->connect();
		$this->database->prepare(
			"select * from users order by users_realname ASC;"
		);
		$this->database->query();
		$content = '<table>';
		$content .= '<tbody><tr><th>'.COLUMNN_NAME.'</th><th>'.ACTION_NAME.'</th></tr>';
		while($userData = $this->database->fetch('array')){
			$content .= "
					<tr><td>
					".$userData['users_username']." ".$userData['users_realname']." "
							.$userData['users_email'] ." ".$userData['users_access_level'] ." ".$userData['users_banned']."</td>
									<td><a href=\"".SERVER_ROOT."?useradmin&page=remove&username=".$userData['users_email']."\">".ALL_USERS_REMOVE."</a> <a href=\"".SERVER_ROOT."?useradmin&page=edit&username=".$userData['users_email']."\">".ALL_USERS_EDIT."</a> 
							</td>
					";
		}
		$content .= '</tbody></table>';
		return $content;
	}
	
}